package org.fastsyncer.manager.logmnr;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.fastsyncer.common.entity.DatabaseConfig;
import org.junit.Test;

public class BeansCopy {

	@Test
	public void copy() throws IllegalAccessException, InvocationTargetException{
		DatabaseConfig cfg1 = new DatabaseConfig(); 
		cfg1.setUsername("yangp as sysdba");
		DatabaseConfig cfg2 = new DatabaseConfig(); 
				
        BeanUtils.copyProperties(cfg2,cfg1);  
        System.out.println(cfg1.toString());  
        System.out.println(cfg2.toString()); 
		
	}
	
}
